#ifndef _I2C_H
#define _I2C_H

#include "stm32f10x.h"
#include "delay.h"



typedef struct{
	
	void (* Config)		(void);
  void (* Start)		(void);
	void (* Stop)			(void);
	void (* Ack)			(void);
	void (* NAck)			(void);
	uint8_t (* WaitAck)	(void);
	void 		(* SendByte)	(uint8_t data);
  uint8_t (* ReadByte)	(uint8_t ack);
	uint8_t (* ReadByteFromSlave)			(uint8_t I2C_Addr,uint8_t reg,uint8_t *buf);
	uint8_t (* ReadMultByteFromSlave)	(uint8_t dev, uint8_t reg, uint8_t length, uint8_t *data);
	uint8_t (* WriteByteToSlave)			(uint8_t I2C_Addr,uint8_t reg,uint8_t data);
	uint8_t (* WriteMultByteToSlave)	(uint8_t dev, uint8_t reg, uint8_t length, uint8_t *data);
	void (* Test)		(void);
}IIC_t;

typedef unsigned short     int uint16_t;

extern IIC_t Iic;



#endif








